from enum import Enum
import datetime


class Weekday(Enum):
    MONDAY = 1
    TUESDAY = 2
    WEDNESDAY = 3
    THURSDAY = 4
    FRIDAY = 5
    SATURDAY = 6
    SUNDAY = 7

    @classmethod
    def from_date(cls, date: datetime.date):
        return cls(date.isoweekday())


class Color(Enum):
    RED = 1
    GREEN = 2
    BLUE = 3


if __name__ == '__main__':

    e3 = Weekday.WEDNESDAY
    print(e3, repr(e3))

    e2 = Weekday(2)
    print(repr(e2))

    print('name', repr(e2.name))
    print('value', repr(e2.value))

    today = Weekday.from_date(datetime.date.today())
    print('today', repr(today))
